<template>
  <view class="search-container" :style="{'background-color':bgcolor}">
    <view class="search-item" :style="{'border-radius': radius + 'px'}" @click="searchBoxHandler">
      <uni-icons type="search" size="17"></uni-icons>
      <text>搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name: "my-search",
    props: {
      bgcolor: {
        type: String,
        default: '#5555ff'
      },
      radius: {
        type: Number,
        default: 18
      }
    },
    data() {
      return {

      };
    },
    methods: {
      searchBoxHandler() {
        this.$emit('mySearchClick')
      }
    }
  }
</script>

<style lang="scss">
  .search-container {
    height: 50px;
    // background-color: #5555ff;
    display: flex;
    align-items: center;
    padding: 0 10px;

    .search-item {
      height: 36px;
      // border-radius: 18px;
      background-color: #fff;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;

      text {
        margin-left: 5px;
        font-size: 15px;
      }
    }
  }
</style>